<?php

header('Content-Type: application/json; charset=utf-8');

mysql_connect("localhost","root","root") or die ("Error al conectar!");
mysql_select_db("LeisureTime") or die ("Verifique la base de datos");

$datos = json_decode($_GET['datos']);

$idCategoria = $datos->idCategoria;


$sql = "SELECT * FROM Subcategorias WHERE idCategoria=$idCategoria";
$resulset = mysql_query($sql);
$rows = array();
while($fila = mysql_fetch_assoc($resulset)){
	$rows[] = array_map('utf8_decode', $fila);
}

echo json_encode($rows);
?>